1 /** 2 * This file is part of libphidget21 3 * 4 * Copyright 2006-2015 Phidgets Inc <patrick@phidgets.com> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 3 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, see 18 * <http://www.gnu.org/licenses/> 19 */ 20 module phidget21.phidlog; 21 22 extern(C) __gshared { 23 enum CPhidgetLog_level { 24 PHIDGET_LOG_CRITICAL = 1, /**< Really important errors that can't be recovered. Usually followed by an abort() */ 25 PHIDGET_LOG_ERROR, /**< Errors that are recovered from. */ 26 PHIDGET_LOG_WARNING, /**< Warning's about weird things that aren't neccesarily wrong. */ 27 PHIDGET_LOG_DEBUG, /**< Should only be used during development - only shows up in the debug library. */ 28 PHIDGET_LOG_INFO, /**< Info about the going on's in the library. */ 29 PHIDGET_LOG_VERBOSE /**< Everything, including very common messages. */ 30 } 31 32 /** 33 * Enables logging. 34 * 35 * Params: 36 * level = The highest level of logging to output. All lower levels will also be output. 37 * outputFile = File to output log to. This should be a full pathname, not a relative pathname. Specify NULL to output to stdout. 38 */ 39 int function(CPhidgetLog_level level, const char* outputFile) CPhidget_enableLogging; 40 41 /** 42 * Disables logging. 43 */ 44 int function() CPhidget_disableLogging; 45 46 /** 47 * Appends a message to the log. 48 * 49 * Params: 50 * level = The level at which to log the message. 51 * id = An arbitrary identifier. 52 * message = The message (printf style). 53 */ 54 int function(CPhidgetLog_level level, const char* id, const char* message, ...) CPhidget_log; 55 }